From: Hashem Nasarat Date: Sun, 27 Jan 2013 19:00:59 +0000 (-0500) Subject: viewSelector: stop launching app from empty search X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~5020 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=8ca25aed8b3d0340393e5222239183d5650bc549;p=gnome-shell.git viewSelector: stop launching app from empty search In the overview, when there is no text in the search entry, this._searchActive will be set to false. Moving the Clutter.Return code block ensures that pressing enter in the search field after deleting the characters of a search will no longer launch the #1 application for the previous search. https://bugzilla.gnome.org/show_bug.cgi?id=692391 --- diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js index c45057c9a..06cd436aa 100644 --- a/js/ui/viewSelector.js +++ b/js/ui/viewSelector.js @@ -368,15 +368,6 @@ const ViewSelector = new Lang.Class({ this.reset(); return true; } - } else if (symbol == Clutter.Return || symbol == Clutter.KP_Enter) { - // We can't connect to 'activate' here because search providers - // might want to do something with the modifiers in activateDefault. - if (this._searchTimeoutId > 0) { - Mainloop.source_remove(this._searchTimeoutId); - this._doSearch(); - } - this._searchResults.activateDefault(); - return true; } else if (this._searchActive) { let arrowNext, nextDirection; if (entry.get_text_direction() == Clutter.TextDirection.RTL) { @@ -401,6 +392,15 @@ const ViewSelector = new Lang.Class({ } else if (symbol == arrowNext && this._text.position == -1) { this._searchResults.navigateFocus(nextDirection); return true; + } else if (symbol == Clutter.Return || symbol == Clutter.KP_Enter) { + // We can't connect to 'activate' here because search providers + // might want to do something with the modifiers in activateDefault. + if (this._searchTimeoutId > 0) { + Mainloop.source_remove(this._searchTimeoutId); + this._doSearch(); + } + this._searchResults.activateDefault(); + return true; } } return false;